#include "pack.h"

void Pack::append(const QString &str)
{
    QByteArray arr = str.toLocal8Bit();

    unsigned short len=arr.length();
    memcpy(buf+buflen, &len, 2);
    buflen+=2;

    memcpy(buf+buflen, arr.data() ,len);
    buflen+=len;
    //更新packsize
    packsize=12+buflen;
}
